package com.kate.mall.order.state;


import com.kate.mall.order.dto.OrderDTO;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/10/30 10:05
 */
public interface OrderStateManager {
    /**
     * 创建订单
     * @param order 订单
     * @throws Exception
     */
    void create(OrderDTO order) throws Exception;

    /**
     * 订单能否执行取消操作
     * @param order 订单
     * @return 能否执行取消操作
     * @throws Exception
     */
    Boolean canCancel(OrderDTO order) throws Exception;
    /**
     * 执行取消订单操作
     * @param order 订单
     * @throws Exception
     */
    void cancel(OrderDTO order) throws Exception;
    /**
     * 订单能否执行支付操作
     * @param order 订单
     * @return 能否执行取消操作
     * @throws Exception
     */
    Boolean canPay(OrderDTO order) throws Exception;
    /**
     * 执行支付订单操作
     * @param order 订单
     * @throws Exception
     */
    void pay(OrderDTO order) throws Exception;

//    /**
//     * 执行预支付订单操作
//     * @param order 订单
//     * @throws Exception
//     */
//    void prePay(OrderDTO order) throws Exception ;

    /**
     * 完成发货操作
     * @param order 订单
     * @throws Exception
     */
    void finishDelivery(OrderDTO order) throws Exception;

    /**
     * 订单能否执行收货操作
     * @param order 订单
     * @return 能否执行取消操作
     * @throws Exception
     */
    Boolean canReceveipt(OrderDTO order) throws Exception;

    /**
     * 确认发货操作
     * @param order 订单
     * @throws Exception
     */
    void confirmReceipt(OrderDTO order) throws Exception;

    /**
     * 订单能否执行申请退货操作
     * @param order 订单
     * @return 能否执行取消操作
     * @throws Exception
     */
    Boolean canApplyReturnGoods(OrderDTO order) throws Exception;

    /**
     * 申请退货
     * @param order 订单
     * @throws Exception
     */
    void applyReturnGoods(OrderDTO order) throws Exception;

    /**
     * 拒绝申请退货
     * @param order 订单
     * @throws Exception
     */
    void rejectReturnGoods(OrderDTO order) throws Exception;
    /**
     * 申请退货审核通过
     * @param order 订单
     * @throws Exception
     */
    void passedReturnGoods(OrderDTO order) throws Exception;

    /**
     * 寄出退货商品
     * @param order 订单
     * @throws Exception
     */
    void sendOutReturnGoods(OrderDTO order) throws Exception;
    /**
     * 确认退货商品
     * @param order 订单
     * @throws Exception
     */
    void confirmReturnGoods(OrderDTO order) throws Exception;
    /**
     * 完成退货入库
     * @param order 订单
     * @throws Exception
     */
    void finishInputReturnGoods(OrderDTO order) throws Exception;
    /**
     * 完成退款
     * @param order 订单
     * @throws Exception
     */
    void finishedRefund(OrderDTO order) throws Exception;

    /**
     * 订单初始状态：创建
     * @param order --订单
     */
    void init(OrderDTO order);
}
